package com.wiscamp.ninechapters.configuration;

import org.springframework.context.annotation.Configuration;

/**
 * 多数据库配置类
 *
 * @author yifeng
 */
@Configuration
public class AllDataSourceConfig {

    /*@Primary
    @Bean(name = "primaryDataSource")
    @Qualifier("primaryDataSource")
    @ConfigurationProperties(prefix = "spring.datasource.primary")
    public DataSource primaryDataSource() {
        System.out.println("Loading database configuration.");
        return DataSourceBuilder.create().build();
    }

    @Bean(name = "secondaryDataSource")
    @Qualifier("secondaryDataSource")
    @ConfigurationProperties(prefix = "spring.datasource.secondary")
    public DataSource secondaryDataSource() {
        return DataSourceBuilder.create().build();
    }

    @Bean(name = "thirdDataSource")
    @Qualifier("thirdDataSource")
    @ConfigurationProperties(prefix = "spring.datasource.third")
    public DataSource thirdDataSource() {
        return DataSourceBuilder.create().build();
    }

    @Bean(name = "fourthDataSource")
    @Qualifier("fourthDataSource")
    @ConfigurationProperties(prefix = "spring.datasource.fourth")
    public DataSource fourthDataSource() {
        return DataSourceBuilder.create().build();
    }

    @Bean(name = "fifthDataSource")
    @Qualifier("fifthDataSource")
    @ConfigurationProperties(prefix = "spring.datasource.fifth")
    public DataSource fifthDataSource() {
        return DataSourceBuilder.create().build();
    }
    */
}
